package cn.juque.systemservice.inits;

import cn.juque.systemservice.cache.AreaInfoCache;
import cn.juque.systemservice.cache.GenInfoCache;
import cn.juque.systemservice.cache.OrgCache;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author nuoka
 * @version 1.0.0
 * <li></li>
 * @date 2022/7/31 20:56
 **/
@Component
public class SystemServiceInitialization implements ApplicationRunner {

    @Resource
    private AreaInfoCache areaInfoCache;

    @Resource
    private OrgCache orgCache;

    @Resource
    private GenInfoCache genInfoCache;

    @Override
    public void run(ApplicationArguments args) {
        this.areaInfoCache.refreshTree();
        this.orgCache.loadOrg();
        this.genInfoCache.refresh();
    }
}
